package cn.dzz.springcloud.controller;

import cn.dzz.springcloud.component.JsonResult;
import cn.dzz.springcloud.entity.Payment;
import cn.dzz.springcloud.service.FeignPaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author DaiZhiZhou
 * @file SpringCloud-ATGG-2020
 * @create 2020-08-26 23:58
 */

@RestController
@Slf4j
public class OpenFeignOrderController {

    @Resource
    private FeignPaymentService feignPaymentService;

    @GetMapping("consumer/payment/get/{id}")
    public JsonResult<Payment> getPaymentById(@PathVariable("id") Long id) {
        return feignPaymentService.getPaymentById(id);
    }
}
